- 3 minutes to read

About the Linked Server RPC, and RPC OUT option

You should set some RPC related settings when you install Nodinite in a distributed environment. However, for consistency and to avoid future support incidents, we recommend following instructions for all types of installations.

Nodinite relies on the SQL Server concept of Linked Servers to connect with SQL Server databases. Nodinite ALSO uses the linked server to join data between the Configuration Database and the Log Databases, even for local installations.

graph LR subgraph "Nodinite" roNS[fal:fa-code-commit Nodinite Core Services] end subgraph "SQL Server Instance" roConfigDatabase(fal:fa-database Configuration database) --- |Linked Server| roLogDatabase(fal:fa-database fal:fa-database fal:fa-database Log databases) roNS --> roConfigDatabase end subgraph "BizTalk SQL Servers" roConfigDatabase -.-> |Linked Server| roBT(fal:fa-database BizTalk Databases) end subgraph "Other SQL Server Instance" roConfigDatabase -.-> |Linked Server| roLogDatabases(fal:fa-database fal:fa-database fal:fa-database Log databases) end

Microsoft has documented the concept of Linked Servers here.

To add a linked server with the RPC and RPC Out settings to true (mandatory for distributed Nodinite installations), execute the following command:

EXEC sp_addlinkedserver @server = 'LOCALHOST\instance';
EXEC sp_serveroption 'LOCALHOST\instance', 'rpc', true;
EXEC sp_serveroption 'LOCALHOST\instance', 'rpc out', true;

Replace 'LOCALHOST\instance' according to your environment

If you are not allowed to execute the command, please add a grant for the user. You cannot add this grant to yourself; Login as a different user with the SYSADMIN right to modify the server:

USE master;
GRANT ALTER ANY LINKED SERVER TO [DOMAIN\LoggingServiceAccountName];
GO
USE master;
GRANT ALTER ANY LOGIN SERVER TO [DOMAIN\LoggingServiceAccountName];

RPC

RPC is disabled by default in SQL Server. This configuration enhances the security of your server by reducing its attackable surface area.

The RPC setting is documented here.

RPC option
RPC option set as recommended to "True".

Nodinite uses remote servers, and the RPC setting enables a certain security feature. If this option is turned off when the second server (the one receiving the login attempt from the first server to which the client connected) tries to validate the remote login, it fails with the following error (example):


18482 "Could not connect to server '%.*ls' because '%.*ls' is not defined as a remote server. Verify that you have specified the correct server name. %.*ls."

You can also set this option to True or False in the linked server's properties by right-clicking on the Linked Server Name in SQL Server Management Studio (SSMS). Otherwise, you can use the following example script to enable RPC:


EXEC master.dbo.sp_serveroption @server=N'LOCALHOST\instance', @optname=N'rpc', @optvalue=N'true' 

Replace 'LOCALHOST\instance' according to your environment

RPC OUT

The RPC OUT setting is needed when working with linked servers (which Nodinite does a lot...).

RPC Out
RPC Out option set as recommended to True

The RPC (Remote Procedure Call) is the stored procedure/ad hoc SQL statement being run remotely from the source SQL Server to the other SQL Server using the Linked Server.

Below are some syntax examples:

Syntax Example
servername.databasename.schemaname.procedurename EXEC [LOCALHOST\instance].master.dbo.sp_who2
EXECUTE(databasename.schemaname.procedurename ) AT %%LINKEDSERVERNAME%% EXEC ('master.dbo.sp_who2') AT [LOCALHOST\instance]

Replace 'LOCALHOST\instance' according to your environment

These kind of "RPC" calls will be blocked unless RPC Out option is set to True on the Linked Server.


Msg 7411, Level 16, State 1, Line 1  Server 'LOCALHOST\instance' is not configured for RPC.

You can also set this option to True or False in the linked server's properties by right-clicking on the Linked Server Name in SQL Server Management Studio (SSMS). Otherwise, you can use the following example script to enable RPC Out.


EXEC master.dbo.sp_serveroption @server=N'LOCALHOST\instance', @optname=N'rpc out', @optvalue=N'false'

Replace 'LOCALHOST\instance' according to your environment.


Next Step